<#
交互式开发助手（原生 PowerShell）
用途：提供常用动作的交互菜单；支持 --action 非交互执行。
用法：
  pwsh -File scripts/windows/interactive-dev.ps1 [--action render-rules|install-git-hooks|check-templates]
#>
param([string]$action)

$WindowsDir = Split-Path -Parent $PSCommandPath
$ScriptsDir = Split-Path -Parent $WindowsDir

function Run-Action([string]$a) {
  switch ($a) {
    'render-rules' { & "$ScriptsDir/render-rules.py"; break }
    'install-git-hooks' { & "$WindowsDir/install-git-hooks.ps1"; break }
    'check-templates' { & "$WindowsDir/check-templates.ps1"; break }
    default { Write-Warning "未知动作：$a" }
  }
}

if ($action) { Run-Action $action; exit 0 }
Write-Host "选择动作：1) render-rules  2) install-git-hooks  3) check-templates"
$sel = Read-Host '输入序号'
switch ($sel) {
  '1' { Run-Action 'render-rules' }
  '2' { Run-Action 'install-git-hooks' }
  '3' { Run-Action 'check-templates' }
  default { Write-Warning '无效选择' }
}
exit 0
